<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group(['middleware' => 'ispc'], function ()
{
	Route::controller('admin/login', 'admin\LoginController');
	Route::get('admin/show',function () {
		return view('admin.show.index');
	});
	Route::group(['middleware' => 'islogon'], function ()
	{
		Route::group(['namespace' => 'admin'], function()
		{
			Route::controller('admin/index', 'IndexController');
			Route::controller('admin/info', 'InfoController');
			Route::controller('admin/user', 'UserController');
			Route::controller('admin/area', 'AreaController');
			Route::controller('admin/building', 'BuildingController');
			Route::controller('admin/room', 'RoomController');
			Route::controller('admin/agent', 'AgentController');
			Route::controller('admin/approval', 'ApprovalController');
			Route::controller('admin/admin', 'AdminController');
			Route::controller('admin/auth', 'AuthController');
			Route::controller('admin/role', 'RoleController');
			Route::controller('admin/debug', 'DebugController');
			Route::controller('admin/notiset', 'NotisetController');
			Route::controller('admin/script', 'ScriptController');
			Route::controller('admin/terrace', 'TerraceController');
			Route::controller('admin/private', 'PrivateController');
			Route::controller('admin/apply', 'ApplyController');
			Route::controller('admin/management', 'ManagementController');
			Route::get('/','LayoutController@index');
			Route::post('/admin/layout/gadget','LayoutController@gadget');
			Route::post('/admin/layout/change','LayoutController@change');
			//lora路由
			Route::controller('admin/dev', 'DevController');
			Route::controller('admin/smoke', 'SmokeController');
			Route::controller('admin/electric', 'ElectricController');
			Route::controller('admin/infrared', 'InfraredController');
			Route::controller('admin/help', 'HelpController');
			Route::controller('admin/gas', 'GasController');
			Route::controller('admin/gateway', 'GatewayController');
			Route::controller('admin/type', 'TypeController');
			Route::controller('admin/model', 'ModelController');
			Route::controller('admin/supplier', 'SupplierController');
		});
		//NB路由组
        Route::group(['namespace' => 'NB'], function()
        {
            //公有路由组
            Route::group(['namespace' => 'common'], function()
            {
                //NB路由
                Route::controller('nb/common/report', 'ReportController');
                Route::controller('nb/common/nbdev', 'NbdevController');
                Route::controller('nb/common/nbbind', 'NbbindController');
            });
            //智慧消防路由组
            Route::group(['namespace' => 'IFF'], function()
            {
                Route::controller('nb/iff/fire_check', 'Fire_checkController');
            });

            Route::group(['namespace' => 'IEU'], function()
            {
                Route::controller('nb/ieu/electric_check', 'Electric_checkController');
            });
            Route::group(['namespace' => 'IG'], function()
            {
                Route::controller('nb/ig/gas_check', 'Gas_checkController');
            });
            Route::group(['namespace' => 'IS'], function()
            {
                Route::controller('nb/is/security_check', 'Security_checkController');
            });
            Route::group(['namespace' => 'SWC'], function()
            {
                Route::controller('nb/swc/cover_check', 'Cover_checkController');
            });
            //智慧用电
            /*Route::group(['namespace' => 'IEU'], function()
            {
                Route::controller('nb/ieu/smoke_check', 'Smoke_checkController');
                Route::controller('nb/ieu/spray_check', 'Spray_checkController');
                Route::controller('nb/ieu/hydrant_check', 'Hydrant_checkController');
                Route::controller('nb/ieu/pool_check', 'Pool_checkController');
            });*/
        });
	});
});

Route::group(['middleware' => 'mobile'],function()
{
	Route::group(['namespace' => 'mobile'], function()
	{
		Route::get('mobile/login','LoginController@index');
	});
});
Route::post('api/lora','API\LoraController@index');
Route::post('api/test','API\NBSmokeController@index');
Route::post('api/security','API\NBSecurityController@index');